# include<stdio.h>
int year(int n)
{
	if ((n % 4 == 0 and n % 100 != 0) or n % 400 == 0)
	{
		return 1;
	}
	return 0;
}

int main()
{
	int i = 0;
	int count = 0;
	for (i = 1000; i <= 2000; i++)
	{
		
		if (year(i) == 1)
		{
			printf("%d ", i);
			count++;
		}
	}
	printf("\n%d\n", count);
	return 0;
}